package net.seabookchen.dao;

import java.util.List;

import net.seabookchen.pojo.Mood;

import com.googlecode.objectify.ObjectifyService;
import com.googlecode.objectify.Query;

public class MoodDao extends ObjectifyGenericDao<Mood> {
	static {
		ObjectifyService.register(Mood.class);
	}

	public MoodDao(Class<Mood> clazz) {
		super(clazz);
	}

	public List<Mood> listMoods(int index) {
		Query<Mood> moods = ofy().query(Mood.class).order("-created").limit(index);
		return deadOrLive(moods);
	}
	
	public List<Mood> listMoods() {
		Query<Mood> moods = ofy().query(Mood.class).order("-created");
		return deadOrLive(moods);
	}
}
